package com.weihoo.manager.service;

import com.weihoo.manager.common.NetUtils;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

/**
 * @Author houyeping
 * @Date 2017/11/27 14:38
 * @Description
 */
@Service
public class loadService implements InitializingBean {

    @Value("${server.port}")
    private int port;

    @Override
    public void afterPropertiesSet() throws Exception {
        getAddress();
    }

    private void getAddress(){
        //获取当前ip
        String host = NetUtils.getLocalHost();
        System.out.println("host:"+host);

        System.out.println("port:"+port);

        int port = NetUtils.getTomcatPort();
        System.out.println("port222:"+port);
    }


}
